﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_UpdateUser')
	BEGIN
		DROP  Procedure  [esf_sso].P_UpdateUser
	END

GO

CREATE Procedure [esf_sso].P_UpdateUser
	@pPersonID					BIGINT
   ,@pIsEnabled					BIT
   ,@pLastUpdateDateTime		DATETIME
   ,@pUserLastUpdateAlias		VARCHAR (20)
   ,@pSecurityQuestionID		BIGINT
   ,@pSecurityQuestionAnswer	VARCHAR (60)
AS
	UPDATE [esf_sso].[User]
	SET 
		[IsEnabled] = @pIsEnabled
	   ,[LastUpdateDateTime] = @pLastUpdateDateTime
	   ,[UserLastUpdateAlias] = @pUserLastUpdateAlias
	   ,[SecurityQuestionID] = @pSecurityQuestionID
	   ,SecurityQuestionAnswer = @pSecurityQuestionAnswer
	WHERE
		[PersonID] = @pPersonID
GO